<div id="tb<?php echo $uniqid;?>" style="padding: 0 8px 0 0;">
<form id="newseditfm" method="post" enctype="multipart/form-data">
<input type="hidden" name="id" value="<?php echo $dataset->id;?>" />
	<table border="0" width="100%" cellspacing="1" cellpadding="5" class="formtable">
		<tr bgcolor="#FFFFFF">
			<td class="tlabel" style="line-height:30px;"  width="10%">标题：</td>
			<td colspan="5" width="90%"><input name="title" type="text" style="width:400px;"  value="<?php echo $dataset->title;?>" class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox" placeholder="请输入标题."  required="true"></td>
		</tr>
		<tr bgcolor="#FFFFFF">
			<td  class="tlabel" >栏目:</td>
			<td class="main" >
			<SELECT name='cat_id' size='1' required="true" class="forminput inputstyle">
			<OPTION value="0">选择栏目</OPTION>
			<OPTION value="0" disabled="disabled"> -------- </OPTION>
			<?php foreach($news_cat as $k=>$v):?>
			<OPTION <?php echo ($dataset->cat_id==$v->id)?"selected":"";?> value="<?php echo $v->id;?>"><?php echo $v->title;?></OPTION>
				<?php foreach($v->children as $k1=>$v1):?>
				<OPTION <?php if($dataset->cat_id==$v1->id){echo "selected";}?> value="<?php echo $v1->id;?>">&nbsp;&nbsp;|--<?php echo $v1->title;?></OPTION>
				<?php endforeach;?>
			<?php endforeach;?>
			</SELECT>
			</td>
			<td class="tlabel">关键词：</td>
			<td colspan="3"><input name="keywords" type="text" style="width:400px;"  value="<?php echo $dataset->keywords;?>"  class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox" placeholder="请输入关键词"></td>
		</tr>
		<tr bgcolor="#FFFFFF">
			<td class="tlabel" >作者:</td>
			<td class="main"><input type="text" size="20" name="author" value="<?php echo $dataset->author;?>"  class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox"  placeholder="请输入作者"></td>

			<td class="tlabel" >来源:</td>
			<td><input type="text" size="20" name="copyfrom" class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox"  placeholder="请输入来源"  value="<?php echo $dataset->copyfrom;?>" ></td>

			<td class="tlabel" >来源网址：</td>
			<td><input type="text" size="45" class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox"  placeholder="请输入来源网址"  name="copyfromurl" value="<?php echo $dataset->copyfromurl;?>" ></td>
		</tr>
		<tr bgcolor="#FFFFFF">
			<td class="tlabel">排序：</td>
			<td class="main"><input type="text" name="sortorder" size="20"  class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox"   value="<?php echo $dataset->sortorder;?>" /></td>
			<td class="tlabel">状态：</td>
			<td><label><input name="status" type="checkbox" class="textbox-prompt" value="1" <?php if($dataset->status==1){echo "checked";}?> >激活</label></td>
			<td class="tlabel" >推荐：</td>
			<td class="main"><label><input type="checkbox" name="recommend" class="textbox-prompt"  <?php if($dataset->recommend==1){echo "checked";}?> value="1" />设为推荐</label></td>
		</tr>
		<tr bgcolor="#FFFFFF">
			<td class="tlabel">缩略图:</td>
			<td class="main" colspan="5">
			<span id="newseditlogo">
			<?php if(!empty($dataset->logo)):?>
			<a target="_blank" href="<?php echo $dataset->logo;?>"><img style="max-height:80px;" src="<?php echo $dataset->logo;?>?imageView2/1" onerror="this.src='/images/none.jpg'" /></a>
			<?php endif;?></span>
			<a href="javascript:;" class="a-upload l-btn"><input type="file" id="newseditupfile" name="upfile" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg" onchange="html5ReaderNewsEdit()"><i class="iconfont icon-xiangji"></i> 点击这里上传缩略图</a>
			</td>
		</tr>
		<tr bgcolor="#FFFFFF">
			<td style="line-height:30px;">内容：</td>
			<td colspan="5">
			<script id="newseditEditor" name="content" type="text/plain">
	        <?php echo $dataset->content->content;?>
		    </script>
			</td>
		</tr>
		<tr>
			<td colspan="6" bgcolor="#F4F4F4" style="border-top:#ddd 1px solid;text-align:right; padding-right:25px;">
			<div>
			<a href="javascript:;" class="l-btn l-btn-small" onclick="newseditsubmitForm()"><span class="l-btn-left l-btn-icon-left"><span class="l-btn-text">保存</span><span class="l-btn-icon icon-ok">&nbsp;</span></span></a>
			<a href="javascript:;" class="l-btn l-btn-small" onclick="newseditclearForm()"><span class="l-btn-left l-btn-icon-left"><span class="l-btn-text">关闭</span><span class="l-btn-icon icon-no">&nbsp;</span></span></a>
			</div>
			</td>
		</tr>
</table>
</form>
</div>

<script>
/***关闭umeditor BOF***/
if(typeof(newseditum)!='undefined'){
		 newseditum.destroy();
}
/***关闭umeditor EOF***/
var newseditum = UM.getEditor('newseditEditor');
var newseditclearForm=function(){
	$('#newseditfm').form('clear');
	$('#rightTabs').tabs('close','编辑文章');
}
var newseditsubmitForm=function(){
	$('#newseditfm').form('submit', {
			url:'/admin/news/newsupdate',
			success: function(data){
				var data = eval('(' + data + ')');

				if(data.code=='200'){
						$.messager.show({
								title:'提示',
								msg:data.msg,
								timeout:3000,
								showType:'slide'
						});
						if(typeof($("#news"))!='undefined') $("#news").datagrid('reload');
						newseditclearForm();
				}else{
						$.messager.alert('提示',data.msg,'warning');
				}
			}
	});
}
</script>
